package com.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: TestCOnfigController
 * @Author: ZhangYue26
 * @Description:
 * @Date: 2021-01-15
 */
@RefreshScope /** 该注解在使用Spring Cloud Bus时，当远程配置文件修改时会自动更新配置 */
@RestController
public class TestConfigController {

    @Value("${foo}")
    public String foo;

    @GetMapping("/getValue")
    public String getValue() {
        return foo;
    }
}
